package com.grom.dao;

import com.grom.po.RelationSecToDep;
import com.grom.util.IDCreator;
import com.holder.DBContextHolder;
import com.holder.DBUTil;

public class RelationSecToDepDaoImpl implements RelationSecToDepDao {

	public void add(RelationSecToDep relation) {
		relation.setID(IDCreator.getSingleId());
		DBContextHolder.setContextConnection(DatabaseDao.getConnection());
		DBUTil.save(relation);
	}

	public void remove(RelationSecToDep relation) {
		DBContextHolder.setContextConnection(DatabaseDao.getConnection());
		String sql = "delete from RelationSecToDep where securityID ='"
				+ relation.getSecurityID() + "' and departmentID='"
				+ relation.getDepartmentID() + "'";
		DBUTil.update(sql);
	}

}
